/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.api;

import com.pingan.haofang.framework.common.functional.lang.control.base.Enums;
import com.pingan.haofang.searchcloud.api.constants.EngineType;

/**
 * 存储集群
 *
 * @author zhangbi617
 * @date 2017-07-17
 */
public class StorageCluster {

    /**
     * 集群hosts
     */
    private String clusterHost;

    /**
     * 集群类型
     */
    private EngineType engineType;

    /**
     * construct
     *
     * @param clusterHost
     * @param engineType
     */
    public StorageCluster(String clusterHost, EngineType engineType) {
        this.clusterHost = clusterHost;
        this.engineType = engineType;
    }

    /**
     * construct
     *
     * @param clusterHost
     * @param engineType
     */
    public StorageCluster(String clusterHost, int engineType) {
        this.clusterHost = clusterHost;
        this.engineType = Enums.findValue(engineType, EngineType.class);
    }


    public String getClusterHost() {
        return clusterHost;
    }

    public void setClusterHost(String clusterHost) {
        this.clusterHost = clusterHost;
    }

    public EngineType getEngineType() {
        return engineType;
    }

    public void setEngineType(EngineType engineType) {
        this.engineType = engineType;
    }

    @Override
    public String toString() {
        return "StorageCluster{" +
                "clusterHost='" + clusterHost + '\'' +
                ", engineType=" + engineType +
                '}';
    }
}
